package cn.hadron.ssh.service.impl;
import java.util.List;

import cn.hadron.ssh.bean.Article;
import cn.hadron.ssh.dao.ArticleDao;
import cn.hadron.ssh.service.ArticleService;
import cn.hadron.ssh.util.Pager;
public class ArticleServiceImpl implements ArticleService{
	private ArticleDao adao;

	@Override
	public void addArticle(Article a) {  
        adao.add(a);  
    } 
	@Override
	public Article findArticle(Integer id){
    	return adao.load(id);
    }
	@Override
	public void modifyArticle(Article a){
		adao.update(a);
    }
	@Override
	public void deleteArticle(Integer id){
		adao.delete(id);
	}
	@Override
	public Pager<Article> getPager(Integer channelId, Integer pageNo,Integer pageSize) {
		return adao.findPager(channelId, pageNo, pageSize);
	}
	@Override
	public Pager<Article> getPager(Integer pageNo,Integer pageSize) {
		return adao.findPager(pageNo, pageSize);
	}
	public ArticleDao getAdao() {
		return adao;
	}
	//Setter注入
	public void setAdao(ArticleDao adao) {
		this.adao = adao;
	}
}
